Skip to content

Site Fixes#890

Open
LadyBluenotes wants to merge 4 commits intomainfrom
site-updates
Open

Site Fixes#890
LadyBluenotes wants to merge 4 commits intomainfrom
site-updates

Conversation

@LadyBluenotes
Copy link
Copy Markdown
Member

@LadyBluenotes LadyBluenotes commented May 5, 2026

Summary by CodeRabbit

  • New Features
    • Landing pages now load code examples lazily, deferring download and render until visible to improve initial load and perceived performance.
  • Refactor
    • Landing pages simplified to self-contained, on-demand example rendering and reduced props/data passed between routes/layouts.
  • Style
    • Tab labels now adjust casing when a matching framework option exists for clearer presentation.
  • Chores
    • Bumped many dependencies and developer tooling to newer versions for stability and performance.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit d290690
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69fa4dafbc885f0008ef6236
😎 Deploy Preview https://deploy-preview-890--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 31 (🔴 down 26 from production)
Accessibility: 90 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 97 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0fb7f13a-6b6a-4b2c-86ca-d178ce6f6c61

📥 Commits

Reviewing files that changed from the base of the PR and between 777ce0e and d290690.

📒 Files selected for processing (1)
  • src/components/markdown/Tabs.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/markdown/Tabs.tsx

📝 Walkthrough

Walkthrough

Adds a lazy-loading landing code example component that defers fetching until visible and replaces prop-driven code-example rendering across multiple landing pages and the landing route; also updates many runtime and dev dependency versions in package.json. No other exported APIs changed.

Changes

Lazy-loading Landing Code Example

Layer / File(s) Summary
Data / Fetcher
src/lib/fetchLandingCodeExample.ts (used)
Existing fetchLandingCodeExample remains the source for landing code example content and is invoked by the new lazy UI.
UI: Placeholder & Lazy Component
src/components/LazyLandingCodeExample.tsx
Adds LandingCodeExamplePlaceholder and LazyLandingCodeExample which uses useIntersectionObserver and useQuery(['landing-code-example', libraryId], { enabled: isIntersecting, staleTime: 5min }) to load content when the element enters the viewport.
Landing Pages
src/components/landing/*Landing.tsx
(FormLanding.tsx, QueryLanding.tsx, RouterLanding.tsx, TableLanding.tsx, VirtualLanding.tsx)
All landing page components stop accepting LandingComponentProps (remove landingCodeExampleRsc) and render <LazyLandingCodeExample libraryId="..."/> instead of the previous inline prop content.
Route / Types
src/routes/-library-landing.tsx
LandingComponentProps changed to Record<string, never>; the route loader no longer fetches or returns landingCodeExampleRsc and now passes only config; LandingComponent is rendered with no props.
Tests / Docs (none changed) No tests or docs modified in this diff.

Dependency & Tooling Version Updates

Layer / File(s) Summary
Runtime Dependencies
package.json (dependencies)
Bumps many runtime packages including @tanstack/ai*, @tanstack/react-query, @netlify/functions, @sentry/*, @shopify/hydrogen-react, @tailwindcss/vite, @react-three/fiber, algoliasearch, lucide-react, postgres, react-instantsearch, resend, tar-stream, valibot, xstate, zod, zustand, etc.
Development Dependencies
package.json (devDependencies)
Bumps dev/test/build tooling such as @playwright/test, @tanstack/react-query-devtools, @types/node, oxlint, tailwindcss, typescript, vite, esbuild, and related utilities.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant LazyComp as LazyLandingCodeExample
  participant QueryClient
  participant Server as fetchLandingCodeExample
  Browser->>LazyComp: mount
  Browser->>LazyComp: element enters viewport (intersection)
  LazyComp->>QueryClient: enable query ['landing-code-example', libraryId]
  QueryClient->>Server: fetchLandingCodeExample(libraryId)
  Server-->>QueryClient: returns contentRsc
  QueryClient-->>LazyComp: data ready
  LazyComp-->>Browser: render contentRsc
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I peek, I wait by viewport's rim,
A hush, then fetch when light grows dim.
Lazy hops bring code to view,
Small delights in bytes anew. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Site Fixes' is too vague and generic to convey meaningful information about the changeset, which includes dependency updates, lazy-loading refactoring, and component restructuring. Provide a more specific title that highlights the main changes, such as 'Refactor landing components to use lazy loading' or 'Add lazy loading for landing code examples and update dependencies'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch site-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/LazyLandingCodeExample.tsx`:
- Around line 48-50: The component currently collapses when data?.contentRsc is
falsy, conflating a true null payload with a failed query; update
LazyLandingCodeExample to destructure isError from the useQuery call and change
the guard to explicitly check for data === null (meaning intentionally empty)
while treating undefined/error separately so that when isError (or data ===
undefined) you render LandingCodeExamplePlaceholder instead of returning null;
keep the existing checks for isIntersecting and isLoading and only return null
when data === null and not when isError is true.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da95e714-b95a-4f49-81f6-3b74899334e6

📥 Commits

Reviewing files that changed from the base of the PR and between bb97bc6 and 777ce0e.

📒 Files selected for processing (7)
  • src/components/LazyLandingCodeExample.tsx
  • src/components/landing/FormLanding.tsx
  • src/components/landing/QueryLanding.tsx
  • src/components/landing/RouterLanding.tsx
  • src/components/landing/TableLanding.tsx
  • src/components/landing/VirtualLanding.tsx
  • src/routes/-library-landing.tsx

Comment on lines +48 to +50
if (isIntersecting && !isLoading && !data?.contentRsc) {
return null
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cat -n src/components/LazyLandingCodeExample.tsx | head -70

Repository: TanStack/tanstack.com

Length of output: 2422


🏁 Script executed:

find src -name "*landing-code-example*" -type f

Repository: TanStack/tanstack.com

Length of output: 109


🏁 Script executed:

cat -n src/utils/landing-code-example.functions.ts

Repository: TanStack/tanstack.com

Length of output: 961


🏁 Script executed:

rg "useQuery" src/components/LazyLandingCodeExample.tsx -A 15

Repository: TanStack/tanstack.com

Length of output: 1347


🏁 Script executed:

rg "isError" src -t tsx -t ts | head -20

Repository: TanStack/tanstack.com

Length of output: 93


🏁 Script executed:

rg "isError" src --type typescript | head -20

Repository: TanStack/tanstack.com

Length of output: 100


🏁 Script executed:

rg "isError" src | head -20

Repository: TanStack/tanstack.com

Length of output: 1020


🏁 Script executed:

rg "isError" src/routes/admin/index.tsx -B 5 -A 5

Repository: TanStack/tanstack.com

Length of output: 392


🏁 Script executed:

rg "useQuery" src/components --max-count 5 -A 8 | head -50

Repository: TanStack/tanstack.com

Length of output: 3632


🏁 Script executed:

rg "useQuery" src/components/admin/DocsCacheTab.tsx -B 2 -A 10 | head -40

Repository: TanStack/tanstack.com

Length of output: 874


🏁 Script executed:

cat -n src/components/LazyLandingCodeExample.tsx

Repository: TanStack/tanstack.com

Length of output: 2422


Handle query errors separately from intentional null payloads.

At line 48, the condition !data?.contentRsc treats both null (when the server intentionally returns no content) and undefined (when the query fails) the same way by returning null. This causes the component to disappear on transient failures instead of displaying the LandingCodeExamplePlaceholder. The query can fail with data being undefined, while a successful response with no content explicitly returns null.

Destructure isError from the useQuery hook and check for data === null explicitly to distinguish between these cases. When an error occurs, render the placeholder instead of collapsing the section.

Suggested patch
-  const { data, isLoading } = useQuery({
+  const { data, isLoading, isError } = useQuery({
    queryKey: ['landing-code-example', libraryId],
    queryFn: () =>
      fetchLandingCodeExample({
        data: {
          libraryId,
        },
      }),
    enabled: isIntersecting,
    staleTime: 5 * 60 * 1000,
  })

-  if (isIntersecting && !isLoading && !data?.contentRsc) {
+  if (isIntersecting && !isLoading && data === null) {
     return null
   }
+
+  if (isError) {
+    return <LandingCodeExamplePlaceholder />
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (isIntersecting && !isLoading && !data?.contentRsc) {
return null
}
const { data, isLoading, isError } = useQuery({
queryKey: ['landing-code-example', libraryId],
queryFn: () =>
fetchLandingCodeExample({
data: {
libraryId,
},
}),
enabled: isIntersecting,
staleTime: 5 * 60 * 1000,
})
if (isIntersecting && !isLoading && data === null) {
return null
}
if (isError) {
return <LandingCodeExamplePlaceholder />
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/LazyLandingCodeExample.tsx` around lines 48 - 50, The
component currently collapses when data?.contentRsc is falsy, conflating a true
null payload with a failed query; update LazyLandingCodeExample to destructure
isError from the useQuery call and change the guard to explicitly check for data
=== null (meaning intentionally empty) while treating undefined/error separately
so that when isError (or data === undefined) you render
LandingCodeExamplePlaceholder instead of returning null; keep the existing
checks for isIntersecting and isLoading and only return null when data === null
and not when isError is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant